package com.springdoor.goods.service.impl;

import java.util.List;
import com.springdoor.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.springdoor.goods.mapper.SprdGoodsDescMapper;
import com.springdoor.goods.domain.SprdGoodsDesc;
import com.springdoor.goods.service.ISprdGoodsDescService;

/**
 * 商品介绍详情Service业务层处理
 * 
 * @author llshs
 * @date 2024-08-09
 */
@Service
public class SprdGoodsDescServiceImpl implements ISprdGoodsDescService {

    @Autowired
    private SprdGoodsDescMapper sprdGoodsDescMapper;

    /**
     * 查询商品介绍详情
     * 
     * @param gNumber 商品介绍详情主键
     * @return 商品介绍详情
     */
    @Override
    public List<SprdGoodsDesc> selectSprdGoodsDescByGNumber(String gNumber)
    {
        return sprdGoodsDescMapper.selectSprdGoodsDescByGNumber(gNumber);
    }

    @Override
    public SprdGoodsDesc selectSprdGoodsDescById(Long descId) {
        return sprdGoodsDescMapper.selectSprdGoodsDescById(descId);
    }

    /**
     * 新增商品介绍详情
     * 
     * @param sprdGoodsDesc 商品介绍详情
     * @return 结果
     */
    @Override
    public int insertSprdGoodsDesc(SprdGoodsDesc sprdGoodsDesc)
    {
        sprdGoodsDesc.setCreateTime(DateUtils.getNowDate());
        return sprdGoodsDescMapper.insertSprdGoodsDesc(sprdGoodsDesc);
    }

    /**
     * 修改商品介绍详情
     * 
     * @param sprdGoodsDesc 商品介绍详情
     * @return 结果
     */
    @Override
    public int updateSprdGoodsDesc(SprdGoodsDesc sprdGoodsDesc)
    {
        sprdGoodsDesc.setUpdateTime(DateUtils.getNowDate());
        return sprdGoodsDescMapper.updateSprdGoodsDesc(sprdGoodsDesc);
    }

    /**
     * 删除商品介绍详情信息
     * 
     * @param descId 商品介绍详情主键
     * @return 结果
     */
    @Override
    public int deleteSprdGoodsDescByDescId(Long descId)
    {
        return sprdGoodsDescMapper.deleteSprdGoodsDescByDescId(descId);
    }
}
